﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Core.Module.Interfaces.Model;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Xml;

namespace Core.Module.Model
{
    [Serializable]
    [XmlRoot("site")]
   public class Site:ISite,IXmlSerializable
    {
       public IModuleNode Node { get; set; }
       public IModuleNode Homepage { get; set; }
       public IModuleNode Settings { get; set; }
       public List<IModule> Modules { get; set; }

       public XmlSchema GetSchema()
       {
           return null;
       }

       public void ReadXml(XmlReader reader)
       {
           throw new NotImplementedException();
       }

       public void WriteXml(XmlWriter writer)
       {
           writer.WriteAttributeString("homepageid", Homepage.Id);
           writer.WriteAttributeString("settingid", Settings.Id);
           writer.WriteRaw(Node.ToXml());        
       }
    }
}
